package idv.jieh.commons.ftp;

import java.io.*;
import idv.jieh.commons.util.ConfigFile;

public final class FTPConfigure {

  private final static String configFilePath = "conf/ftp.properties";

  public static enum KEY{
    FTP_IP, FTP_SERVER_PORT, FTP_USERNAME,
    FTP_PASSWORD, REMOTE_FILE_PATH, LOCATION_FILE_PATH,
    EXEC_FILE, REG_FILE
  }

  private ConfigFile config;

  public FTPConfigure() { this(configFilePath); }

  public FTPConfigure(String configFilePath) {
    try {
      config = new ConfigFile(configFilePath);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  public String getProperty(String propert) {
    return config.getProperty(propert);
  }

  public void setProperty(KEY key, String val) {
    config.setProperty(key.toString(), val);
  }

} // end class FTPConfigure

